package com.mebs.edi.model.edi.e211;

import javax.persistence.Column;
import javax.persistence.Embeddable;

import com.mebs.edi.model.dom.DomAttribute;
import com.mebs.edi.model.dom.DomEntity;

/**
 * 
 * MS3 section of a 211 EDI file 
 * 
 * @author nit
 *
 */
@Embeddable
@DomEntity(name = "MS3")
public class Edi211Ms3 {
	
	@Column(nullable = true, length = 2)
	@DomAttribute
	private String ms301; 		// Standard Carrier Alpha Code
	
	@Column(nullable = true, length = 2)
	@DomAttribute
	private String ms302; 		// Routing Sequence Code
	
	@Column(nullable = true, length = 30)
	@DomAttribute
	private String ms303; 		// City Name
	
	@Column(nullable = true, length = 2)
	@DomAttribute
	private String ms304; 		// Transportation Method/Type Code
	
	@Column(nullable = true, length = 2)
	@DomAttribute
	private String ms305; 		// State or Province Code
	
	public Edi211Ms3() {
		super();
	}
	
	public String getMs301() {
		return ms301;
	}

	public void setMs301(String ms301) {
		this.ms301 = ms301;
	}

	public String getMs302() {
		return ms302;
	}

	public void setMs302(String ms302) {
		this.ms302 = ms302;
	}

	public String getMs303() {
		return ms303;
	}

	public void setMs303(String ms303) {
		this.ms303 = ms303;
	}

	public String getMs304() {
		return ms304;
	}

	public void setMs304(String ms304) {
		this.ms304 = ms304;
	}

	public String getMs305() {
		return ms305;
	}

	public void setMs305(String ms305) {
		this.ms305 = ms305;
	}

	@Override
	public String toString() {
		return "Edi211Ms3 [ms301=" + ms301 + ", ms302=" + ms302 + ", ms303=" + ms303 + ", ms304=" + ms304
				+ ", ms305=" + ms305 + "]";
	}

	@Override
	public int hashCode() {
		final int prime = 31;
		int result = 1;
		result = prime * result + ((ms301 == null) ? 0 : ms301.hashCode());
		result = prime * result + ((ms302 == null) ? 0 : ms302.hashCode());
		result = prime * result + ((ms303 == null) ? 0 : ms303.hashCode());
		result = prime * result + ((ms304 == null) ? 0 : ms304.hashCode());
		result = prime * result + ((ms305 == null) ? 0 : ms305.hashCode());
		return result;
	}

	@Override
	public boolean equals(Object obj) {
		if (this == obj)
			return true;
		if (obj == null)
			return false;
		if (getClass() != obj.getClass())
			return false;
		Edi211Ms3 other = (Edi211Ms3) obj;
		if (ms301 == null) {
			if (other.ms301 != null)
				return false;
		} else if (!ms301.equals(other.ms301))
			return false;
		if (ms302 == null) {
			if (other.ms302 != null)
				return false;
		} else if (!ms302.equals(other.ms302))
			return false;
		if (ms303 == null) {
			if (other.ms303 != null)
				return false;
		} else if (!ms303.equals(other.ms303))
			return false;
		if (ms304 == null) {
			if (other.ms304 != null)
				return false;
		} else if (!ms304.equals(other.ms304))
			return false;
		if (ms305 == null) {
			if (other.ms305 != null)
				return false;
		} else if (!ms305.equals(other.ms305))
			return false;
		return true;
	}
}
